package com.hc.demo.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author hecai
 * @date 2021/12/13 10:19
 */
@ApiModel(value = "com-hc-domain-Dept")
@Getter
@Setter
@ToString
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_dept")
public class MyBatisDept implements Comparable<MyBatisDept> {
    private static final long serialVersionUID = -1050535219404733415L;
    /**
     * 部门编号
     */
    @TableId(value = "deptno", type = IdType.AUTO)
    @ApiModelProperty(value = "部门编号")
    private Integer deptno;

    /**
     * 部门名称
     */
    @TableField(value = "dname")
    @ApiModelProperty(value = "部门名称")
    private String dname;

    /**
     * 部门地址
     */
    @TableField(value = "loc")
    @ApiModelProperty(value = "部门地址")
    private String loc;

    @Override
    public int compareTo(MyBatisDept o) {
        return this.getDeptno() - o.getDeptno();
    }
}